package com.njtoyo.taxi.admin.rest.controller.business;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njtoyo.taxi.admin.mapper.master.entity.DriverDeviceAutoPartnerInformation;
import com.njtoyo.taxi.admin.rest.pojo.dto.DriverDeviceAddDTO;
import com.njtoyo.taxi.admin.rest.wrapper.business.driver.*;
import com.njtoyo.taxi.admin.service.business.DriverDeviceAutoPartnerService;
import com.njtoyo.taxi.admin.service.business.impl.DriverDeviceAutoPartnerServiceImpl;
import com.taxi.entity.common.RestResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("business/driverDevice")
@Api(tags = {"车机设备厂商"})
public class DriverDeviceController {

    @Resource
    private DriverDeviceAutoPartnerServiceImpl driverDeviceAutoPartnerService;

    @GetMapping("/infoList")
    @ApiOperation(value = "车机厂商列表")
    RestResult<Page<DriverDeviceAutoPartnerInformation>> index(DriverDeviceAutoPartnerQueryWrapper wrapper) {
        return driverDeviceAutoPartnerService.getList( wrapper);
    }


    @PostMapping("/add")
    @ApiOperation(value = "新增车机厂商")
    RestResult<Boolean> add(@RequestBody DriverDeviceAddDTO dto) {
        return driverDeviceAutoPartnerService.add(dto);
    }

}
